 

package ppr.jiasharm.gui;

import java.io.*; 
import java.util.*; 
import org.dom4j.Document; 
import org.dom4j.Element; 
import org.dom4j.DocumentException; 
import org.dom4j.io.SAXReader; 
//import javax.swing.*; 
 
public class XmlTester //extends JFrame implements TableData 
{ 
            
  public static void main(String args[]) 
  { 
         
   try 
   { 
 
    XmlTester xmlLeser = new XmlTester(); 
    Document d = xmlLeser.parseUsingSAX(); 
    xmlLeser.printElements(d); 
    } 
     catch(Exception e) 
    { 
     e.printStackTrace(); 
    } 
  } 
     public Document parseUsingSAX() throws    DocumentException, Exception 
     { 
     SAXReader reader = new SAXReader(); 
     Document document = reader.read(new File("D:\\PPR_jiasharm\\src\\ppr\\jiasharm\\gui\\ftpbrute.xml")); 
     return document; 
     } 
 
     public void printElements(Document document) throws DocumentException 
     { 
     Element root = document.getRootElement(); 
      
      // iterieren durch die kindelemente 
     for ( Iterator i = root.elementIterator(); i.hasNext(); ) 
     { 
           Element element = (Element) i.next();           
                  
      System.out.println("Element Name:"+element.getQualifiedName() ); 
      System.out.println("Element Value:"+element.getText()); 
      } 
     } 
}